<?php
session_start();
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false) {
    
}else {
    if (!isset($_SESSION['openid'])){
        $_SESSION['openid']='pc'.uniqid().rand(1,9);
    }
    header('Location: game.php');
    exit;
}
header("Content-Type:text/html;charset=UTF-8");
include_once './c/config.php';
$redirect_uri = urlencode('http://mei94.com/zhong/base.php');
$api_userinfo_base='https://open.weixin.qq.com/connect/oauth2/authorize?appid='.$appId.'&redirect_uri='.$redirect_uri.'&response_type=code&scope=snsapi_base#wechat_redirect';

header('Location: '.$api_userinfo_base);